package edu.nf.ch04.web.controller;

import edu.nf.ch04.common.ResultVO;
import edu.nf.ch04.entity.Student;
import edu.nf.ch04.mapper.StudentMapper;
import edu.nf.ch04.service.StudentService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Author gjh
 * @Date 2025/9/27
 * @Description:
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/stu")
public class StudentController {

    private final StudentService studentService;

    @GetMapping("/{id}")
    public ResultVO<Student> findStu(@PathVariable Integer id){
        return ResultVO.success(studentService.findStuName(id));
    }
}
